Fix a small memory leak
authorMatthias Clasen <mclasen@redhat.com>
Wed, 19 Feb 2014 05:31:40 +0000 (00:31 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 19 Feb 2014 05:31:40 +0000 (00:31 -0500)
GtkPrintUnixDialog was leaking a GFile.
Spotted by Christian Persch in
https://bugzilla.gnome.org/show_bug.cgi?id=724631

gtk/gtkprintunixdialog.c

index 170f36883cc9e8b61392566c90e1fb37fb0796e6..f846a18a06869139f83e0438c57b9c4039309574 100644 (file)
@@ -641,10 +641,14 @@ error_dialogs (GtkPrintUnixDialog *print_dialog,
 
                   if (g_file_query_exists (file, NULL))
                     {
+                      GFile *parent;
+
                       toplevel = get_toplevel (GTK_WIDGET (print_dialog));
 
                       basename = g_file_get_basename (file);
-                      dirname = g_file_get_parse_name (g_file_get_parent (file));
+                      parent = g_file_get_parent (file);
+                      dirname = g_file_get_parse_name (parent);
+                      g_object_unref (parent);
 
                       dialog = gtk_message_dialog_new (toplevel,
                                                        GTK_DIALOG_MODAL |